#include <stdio.h>
#include <stdlib.h>

int* twoSum(int* nums, int numsSize, int target, int* returnSize)
{
    int *p = malloc(sizeof(int)*2);
    *returnSize = 2;
    for(int i = 0;i < numsSize;i++)
    {
        for(int j = i + 1;j < numsSize;j++)
        {
            if((nums[i] + nums[j] ) == target)
            {
                p[0] = i;
                p[1] = j;
                return p;
            }
        }
    } 
}
int main()
{
    int nums[] = {1,3,5,7,9};
    int numsSize = sizeof(nums)/sizeof(nums[0]);
    int target = 6;
    int returnSize = 0;
    int *s = twoSum(nums, numsSize, target, &returnSize);
    for(int i = 0;i <returnSize;i++)
    {
        printf("%d  ",s[i]);
    }
    printf("\n");
    free(s);
    s = NULL;

    return 0;
}